<?php

require_once( 'flexical/admin/view.php' );
require_once( 'flexical/admin/message.php' );

class Flexical_Admin_About_View extends Flexical_Admin_View
{
	public function get_selected_tab()
	{
		return $this->ABOUT_TAB;
	}

	public function render_details( $response )
	{
		$this->render_sidebar();
		$this->render_main();
	}

	public function render_sidebar()
	{
		echo( '<div id="flexical-about-sidebar" style="border-width: 1px; border-color: #000000; border-style: solid; background-color: #ffffff; float: right; width: 200px; padding: 10px;">' );

		echo '<p align="center"><h3>Please show your appreciation of this plugin by donating to The Girl Choir of South Florida</h3></p><p align="center">' . <<<END_OF_FORM
		<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
		<input type="hidden" name="cmd" value="_s-xclick">
		<input type="hidden" name="hosted_button_id" value="EUDVY6S9JHP5N">
		<input type="image" align="center" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
		<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
		</form>

END_OF_FORM;
		echo( '<p align="center"><a href="http://www.girlchoir.org"><img src="' . WP_PLUGIN_URL . '/flexical/images/gcsf-logo.gif" width="150"></a></p>' );
		echo( '<p align="center"><a href="http://www.girlchoir.org"><img style="border-style: solid; border-width: 1px; border-color: #000000;" src="' . WP_PLUGIN_URL . '/flexical/images/gcsf-performance.jpg" width="150"></a></p>' );
		echo( '<p>This widget was created for <a href="http://www.girlchoir.org">The Girl Choir of South Florida</a> to provide listings of its events for its audience as well as its choristers.</p>' );
		echo( '<p>The Girl Choir of South Florida develops the character of young women through excellence in choral music education and performance.</p>' );
		echo( '<p>Your contribution will go into the scholarship fund, which provides tuition and tour scholarships for families in need.</p>' );
		echo( '<hr />' );
		echo( '<p style="font-size: 10px;">The Girl Choir of South Florida is a 501(c)(3) non-profit corporation. All contributions are tax-deductible. The organization is funded by donations, grants, and student tuition fees. The organization is <a href="http://www.sunbiz.org/scripts/cordet.exe?action=DETFIL&inq_doc_number=N05000002892&inq_came_from=NAMFWD&cor_web_names_seq_number=0000&names_name_ind=N&names_cor_number=&names_name_seq=&names_name_ind=&names_comp_name=GIRLCHOIR&names_filing_type=">registered</a> with the Florida Department of Agriculture and Consumer Services, Division of Consumer Services (Reg. No. CH23364).</p>

		<p style="font-size: 10px;">A COPY OF THE OFFICIAL REGISTRATION AND FINANCIAL INFORMATION MAY BE OBTAINED FROM THE DIVISION OF CONSUMER SERVICES BY CALLING TOLL-FREE (800-435-7352) WITHIN THE STATE. REGISTRATION DOES NOT IMPLY ENDORSEMENT, APPROVAL, OR RECOMMENDATION BY THE STATE.</p>' ); 

		echo( '</div>' );
	}

	public function render_main()
	{
		echo( "<div id=\"flexical-about-main\">\n" );
		echo( "<h3>About Flexical</h3>\n" );
		echo( "<p>" . $this->build_project_links() . "</p>\n" );
		echo <<<EOF
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcode.google.com%2Fp%2Fflexical%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
EOF;
		echo '<p>Flexical is a plugin that presents event data from a Google Calendar in widget and short-code form for a Wordpress blog.</p>';

		echo '<p>&nbsp;</p><hr /><h3>Quick Start Guide</h3>';
		echo '<p>To understand how this plugin works, you need to understand the four basic classes of objects that it uses: feeds, queries, formats, and listings. Each of these classes is accessed using the tabs at the top of this page.</p>';
		echo '<h4>Feeds</h4>';
		echo '<p>A <u>feed</u> is a way of accessing a <a href="http://www.google.com/calendar/">Google Calendar</a>. The feed provides the data to display on this blog. For instance, <a href="http://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/full">this feed</a> is for all U.S. holidays.</p>';
		echo '<h4>Queries</h4>';
		echo '<p>A <u>query</u> is a set of criteria used when accessing a feed. The query determines which events will be returned to the blog when accessing a feed. A single query can be used for multiple feeds. For instance, <a href="http://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/full?futureevents=true">this link</a> returns all future U.S. holidays on the calendar.</p>';
		echo '<h4>Formats</h4>';
		echo '<p>A <u>format</u> is a layout of the results of applying queries to feeds. A format is used to display in the blog the data returned from a feed. A single format can be used for multiple event listings.</p>';
		echo '<h4>Listings</h4>';
		echo '<p>A <u>listing</u> is the combination of one or more feeds and queries that produce output using a single format. The data from the feeds is accessed using the query, and a format is used to create the output.</p>';

		echo '<p>&nbsp;</p><hr /><h3>License</h3>' . <<<END_OF_LICENSE
<p>Copyright &copy; 2010 Eric Peterson (<a href="http://www.epeterso2.com">ePeterso2</a>)</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
</p><p>
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
</p><p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</p>
END_OF_LICENSE;

		echo '<p>&nbsp;</p><hr /><h3>Additional Software Packages Included in This Plugin</h3>';
		echo '<ul><li>' . implode( '</li><li>', array (
			'<a href="http://framework.zend.com/">Zend Framework, Gdata Component</a> - Version 1.11.0',
			'<a href="http://www.ama3.com/anytime/">Any+Time&trade; DatePicker/TimePicker AJAX Calendar Widget</a> - Version 4.1112G',
		)) . '</li></ul>';

		echo '<p>&nbsp;</p>';
		echo( "</div>\n" );
	}

	private function build_project_links()
	{
		$project_links = array
		(
			'Home' => 'http://code.google.com/p/flexical/',
			'Downloads' => 'http://code.google.com/p/flexical/downloads/list',
			'Wiki' => 'http://code.google.com/p/flexical/w/list',
			'Issues' => 'http://code.google.com/p/flexical/issues/list',
			'Source ' => 'http://code.google.com/p/flexical/source/checkout',
		);

		$links = '';
		$links .= '<strong>Project Pages - ';

		$link_list = array();
		foreach ( $project_links as $title => $url )
		{
			$link_list[] = '<a href="' . $url . '" target="flexical-project">' . $title . '</a>';
		}

		$links .= implode( ' | ', $link_list );
		$links .= '</strong>';

		return $links;
	}
}

?>
